export default {
	namespaced: true,
	state: {
		address: uni.getStorageSync('address') || null,
		userProfile: uni.getStorageSync('userProfile') || {
			avatarUrl: 'http://tmp/Bi6xmMpMY1jK7c63a246657cac63cd2bed6b3ca39132.jpeg',
			nickName: '微信用户'
		}
	},
	mutations: {
		addAddress(state, address) {
			state.address = address
			uni.setStorageSync('address', address)
		},
		saveUserprofile(state, userProfile) {
			state.userProfile = userProfile
			uni.setStorageSync('userProfile', userProfile)
		}
	},
	// getters: {
	// 	userInfo(state) {
	// 		return state.userProfile.userInfo
	// 	}
	// }
}
